public class Controle{
  Paddle paddle;
  float distWall,c=height/2;
  
  Controle(Paddle paddle, float distWall){
    this.paddle=paddle;
    this.distWall=distWall;
  }
  
  void mouseY(){
     paddle.y = constrain(mouseY, paddle.h  + paddle.w + distWall +25, height - paddle.h - paddle.w - distWall);
  }
  
  void mouseX(){
    paddle.x=mouseX;
  }
  
  void teclado(int cima, int baixo, int pb){
    
    paddle.y=constrain(c, paddle.h  + paddle.w + distWall +25, height - paddle.h - paddle.w - distWall);
    
    if(keyPressed){
       if(keyCode==baixo && c<height - paddle.h - paddle.w - distWall)
         c +=10;
       if(keyCode==cima && c> paddle.h  + paddle.w + distWall +25)
         c -=10;
       if(keyCode==pb)
         
         liga=true;  
     }
  }
  
  
   void teclado(char cima, char baixo, char pb){
    
    paddle.y=constrain(c, paddle.h  + paddle.w + distWall +25, height - paddle.h - paddle.w - distWall);
    
    if(keyPressed){
       if(key==baixo && c<295)
         c +=15;
       if(key==cima && c>90)
         c -=15;
       
       if(key==pb)
         liga=true;  
     }
  }
  
  
  
}//fim da classe
